﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Forum.Master" AutoEventWireup="true" CodeBehind="MainBlog.aspx.cs" Inherits="Client.WebForm9" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="Scripts/json2.js"></script>
<script type="text/javascript" src="Scripts/json_parse.js"></script>
<script type="text/javascript" src="Scripts/json_parse_state.js"></script>
<script type="text/javascript" src="Scripts/cycle.js"></script>
<script type="text/javascript" src="Scripts/1.js"></script> 
<script src="http://code.jquery.com/jquery-latest.js"></script>
 <script src="Scripts/jquery-1.8.2.js"></script>
    <script src="Scripts/jquery-ui-1.9.1.custom.js"></script>
    <link rel="stylesheet" href="Styles/jquery-ui-1.9.2.custom.css" />
    <link rel="stylesheet" href="Styles/ThuNhoAnh.css"/>
    <link rel="stylesheet" href="Styles/jquery-ui.css" />

    <link rel="stylesheet" media="screen" href="lib/datatables/css/cleanslate.css" />
     <script type="text/javascript" src="lib/datatables/js/jquery.dataTables.js"></script> 
<script>
    $(function () {
        var URL = 'http://localhost:18796/api/values/';
        $(function () {

            jQuery.support.cors = true;
            $.ajax({
                url: URL + '?post=a',
                type: 'GET',
                datatype: 'json',
                success: function (data) {
                     $("#TablePost").empty();
                    for (var i = 0; i < data.length; i++) {
                        $("#TablePost").append(
                        "<tr> <td>"+data[i].ID+"</td>"+"<td class='TdImg'><div class='content_section'>" +
                        "<h2><a href='localhost:18791/HienThiPost.aspx?ID=" + data[i].ID + "'>" + data[i].TuaDe + "</a></h2>" +
                  	    data[i].NoiDung +
            	        "</div></td></tr>"
                    );
                    }
                    $('#exam').dataTable();

                },
                error: function () {
                    alert("MainBlog");
                }
            });
        });
        var b = setInterval(function () {

            jQuery.support.cors = true;
            $.ajax({
                url: URL + '?post=a',
                type: 'GET',
                datatype: 'json',
                success: function (data) {
                    $("#TablePost").empty();
                    for (var i = 0; i < data.length; i++) {
                        $("#TablePost").append(
                        
                        "<tr> <td>"+data[i].ID+"</td>"+"<td class='TdImg'><div class='content_section'>" +
                        "<h2><a href='localhost:18791/HienThiPost.aspx?ID=" + data[i].ID + "'>" + data[i].TuaDe + "</a></h2>" +
                  	    data[i].NoiDung +
            	        "</div></td></tr>"
                    );
                    }
                    $('#exam').dataTable();
                },
                error: function () {
                    alert("Loi");
                }
            });
        }, 90000);
    });
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="XemThuNoiDung">
    
            
            	<div class="content_section">
            
                    <h2>Welcome to Travel &amp; Tour</h2>
                    
                     <a href="http://www.templatemo.com" target="_parent">Free Website Templates</a> are provided by <a href="http://www.templatemo.com" target="_parent">TemplateMo.com</a>. Feel free to download, edit and use this template for your websites. Credit goes to <a href="http://www.publicdomainpictures.net" target="_blank">Public Domain Picutures</a> for the header picture used in this template.
                  	 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et quam vitae ipsum vulputate varius vitae semper nunc. Quisque eget elit quis augue pharetra feugiat. Suspendisse turpis arcu, dignissim ac laoreet a, condimentum in massa.
                        
            	</div>                
   
</div>
<table id="exam">
                <thead> 
                                    <tr> 
                                        <th>ID</th>
                                        <th>Bài Post</th> 
                                  </tr> 
                                </thead>
    <tbody id="TablePost">
       
    </tbody>
</table>
</asp:Content>
